import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import Hotel from '../views/hotel.vue'
import Index from '@/views/platform/Index/index.vue'
import Reserve from '@/views/platform/Index/reserve.vue'


const routes = [
  {
    path: '/',
    name: 'home',
    component: Home,
    // redirect: '/index',
  },
  {
    path: '/hotel',
    name: 'hotel',
    component: Hotel,
    redirect: '/index',
    children: [
      {
        //简介
        path: '/index',
        name: 'index',
        component: Index,
      },
      {
        //订单
        path: '/reserve',
        name: 'reserve',
        component: Reserve,
      }
    ],
  },

  //放在最下面, 将匹配所有内容并将其放在 `$route.params.pathMatch` 下
  // {
  // 	path: '/:pathMatch(.*)*',
  // 	component: NotFound,
  // },
]

const router = createRouter({
  // history: createWebHistory(process.env.NODE_ENV === 'production'? './webadmin': './'), 配置子目录
  history: createWebHistory(),
  routes,
})

export default router
